#include<stdio.h>
#include<math.h>
#include<time.h>
int main()
{
   int a[1000][2],n,M,m,s,ave;
   float b[1000],M2,m2,s2,ave2;
   srand((unsigned)time(NULL));
   for(n=0;n<100;n++)
   {
      a[n][1]=n+1;
      printf("%d ",a[n][1]);
      a[n][2]=rand()%100;
      printf("%d ",a[n][2]);
      b[n]=1/(float)a[n][2];
      printf("%f\n",b[n]);
   }
   M=m=a[0][2];
   M2=m2=b[0];
   s=0;
   s2=0;
   for(n=0;n<100;n++)
   {
      if(a[n][2]>=M)M=a[n][2];
      if(a[n][2]<=m)m=a[n][2];
      if(b[n]>=M2)M2=b[n];
      if(b[n]<=m2)m2=b[n];
      s=s+a[n][2];
      s2=s2+b[n];
   }
   ave=s/100;
   ave2=s2/100;
   printf("max ");
   printf("%d %f\n",M,M2);
   printf("min ");
   printf("%d %f\n",m,m2);
   printf("average ");
   printf("%d %f\n",ave,ave2);
   return 0;
}
